package com.example.win.android_banduyujia.venuesactivity.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import com.example.win.android_banduyujia.R;
import com.example.win.android_banduyujia.entity.DoorEntity;
import com.example.win.android_banduyujia.peopleactivity.ui.activity.BaseTitleBarActivity;
import com.example.win.android_banduyujia.venuesactivity.activity.classactivity.ClassesCancelActivity;
import com.example.win.android_banduyujia.venuesactivity.activity.classactivity.NameActivity;
import com.example.win.android_banduyujia.venuesactivity.activity.classactivity.ClassesNumberActivity;
import com.example.win.android_banduyujia.venuesactivity.activity.classactivity.ClassesPriceActivity;
import com.example.win.android_banduyujia.venuesactivity.activity.classactivity.describe.DescribeActivity;
import com.example.win.android_banduyujia.venuesactivity.activity.classactivity.teachtime.TeachtimeActivity;

import java.util.HashMap;
import java.util.List;

/**
 * Created by huchun on 2015/8/17.
 */
public class VenuesTarActivity extends BaseTitleBarActivity implements View.OnClickListener {
    private static final  String  TAG = VenuesTarActivity.class.getSimpleName();

    private LinearLayout LayoutName, LayoutDesc, LayoutTime, LayoutNumber, LayoutPrice, LayoutCancel;
    private Button BtnSubmit;

    private DoorEntity mdoorentity;
    private boolean  isFirst = true;

    private List<String> listDataHeader;
    private HashMap<String, List<String>> listDataChild;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_venues_page);

        InitTitles();
        InitViews();
    }

    private void InitTitles() {
        showLeftBackButton();
        setTitle(R.string.fragment_my_release_course);
    }

    private void InitViews() {
        LayoutName= (LinearLayout)findViewById(R.id.layout_linear_classes_name);
        LayoutDesc = (LinearLayout)findViewById(R.id.layout_linear_classes_describe);
        LayoutTime = (LinearLayout) findViewById(R.id.layout_linear_teach_time);
        LayoutNumber = (LinearLayout)findViewById(R.id.layout_linear_classes_number);
        LayoutPrice = (LinearLayout)findViewById(R.id.layout_linear_classes_price);
        LayoutCancel = (LinearLayout)findViewById(R.id.layout_linear_classes_cancel);

        BtnSubmit = (Button)findViewById(R.id.layout_button_classes_release);
        BtnSubmit.setOnClickListener(this);

        /*mExpandableListView= (ExpandableListView) findViewById(R.id.venues_expandableListView);
        mExpandAdapter = new ExpandAdapter(this);
        mExpandableListView.setAdapter(mExpandAdapter);
        mExpandableListView.expandGroup(0);
        mExpandableListView.setOnGroupClickListener(this);
        mExpandableListView.setOnChildClickListener(this);*/

        LayoutName.setOnClickListener(this);
        LayoutDesc.setOnClickListener(this);
        LayoutTime.setOnClickListener(this);
        LayoutNumber.setOnClickListener(this);
        LayoutPrice.setOnClickListener(this);
        LayoutCancel.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.layout_linear_classes_name:  // 课程名称
                NameActivity();
                break;
            case R.id.layout_linear_classes_describe: // 课程描述
                DescribeActivity();
                break;
            case R.id.layout_linear_teach_time: // 授课时间
                TeachingActivity();
                break;
            case R.id.layout_linear_classes_number:  // 上课人数
                NumberActivity();
                break;
            case R.id.layout_linear_classes_price:  // 课时价格
                PriceActivity();
                break;
            case R.id.layout_linear_classes_cancel:  // 取消政策
                CancelActivity();
                break;
            case R.id.layout_button_classes_release: // 确认发布
                ConfirmActivity();
                break;
        }
    }

    private void NameActivity() {
        startActivity(new Intent(this, NameActivity.class));
    }

    private void DescribeActivity() {
        startActivity(new Intent(this, DescribeActivity.class));
    }

    private void TeachingActivity() {
        startActivity(new Intent(this, TeachtimeActivity.class));
    }

    private void NumberActivity() {
        startActivity(new Intent(this, ClassesNumberActivity.class));
    }

    private void PriceActivity() {
        startActivity(new Intent(this, ClassesPriceActivity.class));
    }

    private void CancelActivity() {
        startActivity(new Intent(this, ClassesCancelActivity.class));
    }

    private void ConfirmActivity() {

    }
}
